home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / olrdrs / bwdev201.zip / BLUEWAVE.H next >
C/C++ Source or Header  |  1994-01-18  |  60KB  |  1,025 lines

  1. /*****************************************************************************/
  2. /*                                                                           */
  3. /*           The Blue Wave Offline Mail System Packet Structures             */
  4. /*     Copyright 1990-1994 by George Hatchew and Cutting Edge Computing      */
  5. /*                 All rights reserved - FidoNet 1:2240/176                  */
  6. /*                                                                           */
  7. /*                     Last Updated - January 18, 1994                       */
  8. /*                                                                           */
  9. /*        ---------------------------------------------------------          */
  10. /*            DISTRIBUTION OF THIS FILE IS LIMITED BY THE TERMS              */
  11. /*           SPECIFIED IN THE BLUE WAVE STRUCTURE DOCUMENTATION!             */
  12. /*        ---------------------------------------------------------          */
  13. /*                                                                           */
  14. /*     These data structures should be usable with any C compiler that       */
  15. /*  supports the ANSI standard for the C language (i.e. ANSI C).  They are   */
  16. /*  NOT guaranteed to be usable with older compilers, which largely relied   */
  17. /*   on the definition of the language as specified in _The C Programming    */
  18. /*       Language (1st Edition)_ by Brian Kernighan & Dennis Ritchie.        */
  19. /*                                                                           */
  20. /*****************************************************************************/
  21.  
  22. #ifndef __BLUEWAVE_H    /*  An extra safeguard to prevent this header from  */
  23. #define __BLUEWAVE_H    /*  being included twice in the same source file    */
  24.  
  25.  
  26. #define PACKET_LEVEL    2       /* The current mail packet revision level, */
  27.                                 /*   used in the "ver" field of the *.INF  */
  28.                                 /*   file header.                          */
  29.  
  30.  
  31. /*
  32. **  This header defines the data structures for the following files in the
  33. **  official Blue Wave offline mail specification:
  34. **
  35. **      Door:       *.INF       BBS and message area information
  36. **                  *.MIX       Quick index to *.FTI records
  37. **                  *.FTI       Information for all packet messages
  38. **                  *.DAT       Packet message text
  39. **
  40. **      Reader:     *.NET       NetMail reply message information
  41. **                  *.UPI       Information for all other reply messages
  42. **                  *.UPL       Reply message information (* NEW *)
  43. **                                  (designed to replace the NET/UPI combo,
  44. **                                  which will soon be obsolete)
  45. **                  *.REQ       List of files to download from BBS
  46. **                  *.PDQ       Offline door configuration information
  47. **
  48. **      Misc:       *.MSG       Fido-style message header
  49. **                                  (used *only* in the *.NET structure, and
  50. **                                  will soon be obsolete)
  51. **                  *.XTI       Extended message packet information
  52. **                                  (not an official part of the Blue Wave
  53. **                                  packet specification; is used by the Blue
  54. **                                  Wave reader only)
  55. **
  56. **  The door files (plus individual files for BBS bulletins) comprise a Blue
  57. **  Wave message packet, and the reader files (plus individual files for each
  58. **  message) comprise a Blue Wave reply packet.
  59. **
  60. **  In order to cover ALL BASES, and to be able to say that you were warned,
  61. **  *ALL* unused fields should be set to ASCII NUL (0).  Any future
  62. **  implementation of reserved fields will rely on the premise that the field
  63. **  will be 0 if not implemented!  The same warning follows for BITMAPPED
  64. **  fields.  If a bit is not implemented or is not used, TURN IT OFF (0).
  65. **  (Clearing an entire structure can be easily accomplished via the memset()
  66. **  function.  Example: "memset(&ftirec, 0, sizeof(FTI_REC))".)
  67. */
  68.  
  69.  
  70. /*****************************************************************************/
  71. /* >>>>>>>>>>>>>>>>>>>>>>>  DATA TYPE DEFINITIONS  <<<<<<<<<<<<<<<<<<<<<<<<< */
  72. /*****************************************************************************/
  73.  
  74.  
  75. /*
  76. **  The data type definitions below help make these structures a little more
  77. **  universal between environments.  The 8-bit, 16-bit, and 32-bit data types
  78. **  defined below can be used as-is with virtually all MS-DOS and OS/2 C/C++
  79. **  compilers, but can be changed if necessary should your compiler define
  80. **  data types in a different fashion.  (Note that the tCHAR and tINT types
  81. **  are currently not used; they are included simply for completeness.)
  82. **
  83. **  If you are programming for a system that employs a CPU which stores multi-
  84. **  byte integers in a manner other than in Intel format (LSB-MSB, or "little
  85. **  endian"), simply #define BIG_ENDIAN before #including this header.  As
  86. **  shown below, this will define the data types as arrays of bytes; the
  87. **  drawback is that *YOU* will have to write functions to convert the data,
  88. **  since the Blue Wave packet specification requires the data to be in Intel-
  89. **  style little-endian format.
  90. **
  91. **  IMPORTANT NOTE ABOUT COMPILERS AND STRUCTURES:
  92. **  All structures *must* be "packed" (i.e., the compiler MUST NOT insert
  93. **  padding bytes between structure elements in order to force elements onto
  94. **  word boundaries).  The Blue Wave products expect them to be packed; if
  95. **  they aren't, you're bound to get some *very* interesting results.
  96. */
  97.  
  98. #ifdef BIG_ENDIAN
  99.  
  100. typedef signed char    tCHAR;     /* 8 bit signed values           */
  101. typedef unsigned char  tBYTE;     /* 8 bit unsigned values         */
  102. typedef unsigned char  tINT[2];   /* little-endian 16 bit signed   */
  103. typedef unsigned char  tWORD[2];  /* little-endian 16 bit unsigned */
  104. typedef unsigned char  tLONG[4];  /* little-endian 32 bit signed   */
  105. typedef unsigned char  tDWORD[4]; /* little-endian 32 bit unsigned */
  106.  
  107. #else
  108.  
  109. typedef signed char    tCHAR;     /* 8 bit signed values    */
  110. typedef unsigned char  tBYTE;     /* 8 bit unsigned values  */
  111. typedef signed short   tINT;      /* 16 bit signed values   */
  112. typedef unsigned short tWORD;     /* 16 bit unsigned values */
  113. typedef signed long    tLONG;     /* 32 bit signed values   */
  114. typedef unsigned long  tDWORD;    /* 32 bit unsigned values */
  115.  
  116. #endif
  117.  
  118.  
  119. /*****************************************************************************/
  120. /* >>>>>>>>>>>>>>>>>>>>>  DOOR DATA FILE STRUCTURES  <<<<<<<<<<<<<<<<<<<<<<< */
  121. /*****************************************************************************/
  122.  
  123.  
  124. /*
  125. **  Name of file:   *.INF
  126. **
  127. **  Description:    The *.INF file is the source of information for just about
  128. **                  everything from the host BBS, as well as definitions for
  129. **                  all of the message areas that are available to the user
  130. **                  and their status (Local, EchoMail, NetMail, Read Only,
  131. **                  etc.).
  132. **
  133. **  File format:    INF_HEADER          { only included one time!        }
  134. **                  INF_AREA_INFO       { repeated for as many msg bases }
  135. **                  INF_AREA_INFO       { as are available to the user   }
  136. **                  ...
  137. */
  138.  
  139. /*  Bit-masks for INF_HEADER.UFLAGS field  */
  140.  
  141. #define INF_HOTKEYS     0x0001      /* User uses "hotkeys" in door prompts   */
  142. #define INF_XPERT       0x0002      /* Short menus displayed in door         */
  143. #define INF_RES1        0x0004      /* RESERVED -- DO NOT USE!               */
  144. #define INF_GRAPHICS    0x0008      /* Enable ANSI control sequences in door */
  145. #define INF_NOT_MY_MAIL 0x0010      /* Do not bundle mail from user          */
  146.  
  147. /*  Bit-masks for INF_HEADER.NETMAIL_FLAGS field  */
  148.  
  149. #define INF_CAN_CRASH   0x0002      /* Allow Crash status          */
  150. #define INF_CAN_ATTACH  0x0010      /* Allow File Attach messages  */
  151. #define INF_CAN_KSENT   0x0080      /* Allow Kill/Sent status      */
  152. #define INF_CAN_H